# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=py3-pydot
pkgver=2.0.0
pkgrel=0
pkgdesc="Python interface to Graphviz's Dot language"
url="https://github.com/pydot/pydot"
arch="noarch"
license="MIT"
depends="python3 py3-parsing"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-chardet graphviz"
subpackages="$pkgname-pyc"
source="https://github.com/pydot/pydot/archive/v$pkgver/pydot-v$pkgver.tar.gz"
options="!check" # graphviz unable to parse jpe files
builddir="$srcdir/pydot-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
09102930a59ac4339e1d1e4f7a9d075f99eda6cb060885631a72f1fded90d001bd02940b55addc0c92856e95321cb3b344a1797b4809ac7c9048ac57c81d4707  pydot-v2.0.0.tar.gz
"
